---
{{- $versionInfo := get .Values.istio.internal.versionMap .Values.istio.internal.globalVersion }}
{{- $revision := get $versionInfo "revision" }}

# Workaround for https://github.com/istio/istio/issues/27501
apiVersion: v1
kind: Service
metadata:
  name: istiod
  namespace: d8-istio
  annotations:
    istio.deckhouse.io/global-version: {{ .Values.istio.internal.globalVersion | quote }}
  {{- include "helm_lib_module_labels" (list . (dict "app" "istiod" "istio" "pilot" "istio.io/rev" $revision)) | nindent 2 }}
spec:
  ports:
  - name: grpc-xds
    port: 15010
    protocol: TCP
    targetPort: 15010
  - name: https-dns
    port: 15012
    protocol: TCP
    targetPort: 15012
  - name: https-webhook
    port: 443
    protocol: TCP
    targetPort: 15017
  - name: http-monitoring
    port: 15014
    protocol: TCP
    targetPort: 15014
  selector:
    app: istiod
    istio.io/rev: {{ $revision }}
  type: ClusterIP
